package com.android;



import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class OnClickListenerActivity extends Activity 
{
    /** Called when the activity is first created. */
	private Button click;
	private TextView txt;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        click =(Button)findViewById(R.id.button1);
        txt   =(TextView)findViewById(R.id.textView1);
     
       click.setOnClickListener(
        		new OnClickListener() {
					
					public void onClick(View arg0) {
						// TODO Auto-generated method stub
					
						txt.setText("Cancel to complete.");
					}
				}
        );
    }
}